import java.util.Random;

/**
 * @author gaopeng
 * @date 2019/12/12 11:14 下午
 */
public class Sale extends AbstractColleague {
    public Sale(AbstractMediator mediator) {
        super(mediator);
    }

    public void sellComputer(int number){
        super.mediator.execute("sale.sell",number);
        System.out.println("销售电脑："+number+"台");
    }

    public int getSaleState(){
        Random random = new Random(System.currentTimeMillis());
        int saleState = random.nextInt(100);
        System.out.println("电脑销售情况为："+saleState);
        return saleState;
    }

    public void offSale(){
        super.mediator.execute("sale.offsell",0);
    }
}
